﻿<paging:MtPage x:Class="WindowsStoreApplicationTemplate.Views.MainPage"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:paging="using:MyToolkit.Paging" 
               xmlns:viewModels="using:WindowsStoreApplicationTemplate.ViewModels"
               mc:Ignorable="d"
               x:Name="PageRoot">

    <paging:MtPage.Resources>
        <viewModels:MainPageModel x:Key="ViewModel" />
    </paging:MtPage.Resources>

    <Grid DataContext="{StaticResource ViewModel}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <!-- header -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <Button Margin="39,59,39,0" Command="{Binding Frame.GoBackCommand, ElementName=PageRoot}"
                    Style="{StaticResource NavigationBackButtonNormalStyle}" VerticalAlignment="Top"
                    AutomationProperties.Name="Back"
                    AutomationProperties.AutomationId="BackButton"
                    AutomationProperties.ItemType="Navigation Button"/>

            <TextBlock Text="Main Page" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                       IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
        </Grid>

        <!-- content -->
        <StackPanel Grid.Row="1" Margin="120,0,0,0">
            <!-- TODO: Add your controls here -->
            <Button Content="Show Details page"
                    Command="{Binding ShowDetailsCommand}" 
                    CommandParameter="{Binding SelectedPerson}" />
        </StackPanel>
    </Grid>
</paging:MtPage>
